package com.todo.member.iface.backend.base;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

/**
 * @author azhebuxing
 * @date 2025/2/12 20:31
 * @description
 */
@Data
public class MemberLevelReward {

    @Schema(title = "等级奖励列表", description = "等级奖励列表")
    private List<LevelReward> levelRewardList;


    @Data
    public static class LevelReward {

        @Schema(title = "发放批次", description = "发放批次")
        private String grantBatch;

        @Schema(title = "奖励类型", description = "奖励类型")
        private Integer rewardType;

        @Schema(title = "奖励描述", description = "奖励描述")
        private String rewardDesc;
    }

    public boolean baseCheck() {
        if (levelRewardList == null){
            return true;
        }
        for (LevelReward levelReward : levelRewardList) {
            if (levelReward.getGrantBatch() == null || levelReward.getRewardType() == null || levelReward.getRewardDesc() == null){
                return false;
            }
        }
        return true;
    }
}
